Component({
  data: {
    options: ["男", "女"],
    selected: 0
  },
  properties: {
    default: {
      type: Number,
      value: 0,
      observer(val) {
        this.setData({
          selected: val
        })
      }
    }
  },
  attached() {

  },
  methods: {
    onselect(e) {
      let index = e.currentTarget.dataset.index;
      this.setData({
        selected: index
      })
      this.triggerEvent('change', index);
    }
  }
})